package com.baikeyang.common.constant;

import com.baikeyang.common.util.StringUtils;

import java.util.ResourceBundle;

public class QiniuConstants {

	private static final ResourceBundle bundle = ResourceBundle.getBundle( "config/config" );

	private static String uploadDisk= "system.file.upload.disk";

	private static String uploadDirPath = "system.file.upload.directory";

	private static String accessKey = "system.file.storage.qiniu.accessKey";

	private static String secretKey = "system.file.storage.qiniu.secretKey";

	private static String bucketKey = "system.file.storage.qiniu.bucket";

	public static String getUploadDirPath() {
		String disk = bundle.getString(uploadDisk);
		if(StringUtils.isEmpty(disk)){
			disk = "D:";
		}
		String dirPath = bundle.getString(uploadDirPath);
		if(StringUtils.isEmpty(dirPath)){
			dirPath = "/upload";
		}
		return dirPath;
	}

	public static String getAccessKey() {
		String aKey = bundle.getString(accessKey);
		if(StringUtils.isEmpty(aKey)){
			aKey = "DIoJ0oXEoczT6BJXMhnp-9CESvatRMjtu8TlEtI0";
		}
		return aKey;
	}

	public static String getSecretKey() {
		String sKey = bundle.getString(secretKey);
		if(StringUtils.isEmpty(sKey)){
			sKey = "KXtQie6CIoaRB11I6QAiMg3t9C8BIfrv44dRoVAw";
		}
		return sKey;
	}

	public static String getBucket() {
		String bucket = bundle.getString(bucketKey);
		if(StringUtils.isEmpty(bucket)){
			bucket = "youthbucket";
		}
		return bucket;
	}

}
